<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,maximum-scale=1.0" />
    <title><#if entity.columnId??>编辑<#else>新增</#if>表属性</title>
    <#include "/view/admin/head.html"/>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />


    <script type="text/javascript" src="${base}/jstool/bootstrap-validator-0.5.3/js/bootstrapValidator.min.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-validator-0.5.3/lang/zh_CN.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-validator-0.5.3/css/bootstrapValidator.min.css" />


    <style type="text/css">
        .list-path {
            height: 50px;
            line-height: 50px;
            background-color: #9acfea;
        }

        .table-class {
            width: 90%;
            text-align: center;
            border: 1px solid #afd9ee;
            margin: 0 auto;
            margin-top: 50px;
        }

        table th {
            width: 20%;
            background-color: #d9edf7;
            text-align: right;
        }

        table td {
            width: 20%;
            text-align: left;
        }


    </style>
    <script type="text/javascript">

        $(function(){
            //初始化








                $('#createtime').datetimepicker({language: 'zh-CN' });
                $('#updatetime').datetimepicker({language: 'zh-CN' });



            $('#xycolumnForm').bootstrapValidator({
                message: 'This value is not valid',
                feedbackIcons: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
                fields: {



                    
                name:{
                    message: '输入属性名出错',
                    validators:{
                        notEmpty: {
                            message: '属性名不能为空'
                        },
                        stringLength:{
                            max: 19,
                            message: '属性名不能超过 19个字符'
                        }
                    }
                }





                    ,
                length:{
                    message: '输入长度出错',
                    validators:{
                        notEmpty: {
                            message: '长度不能为空'
                        },
                        stringLength:{
                            max: 5,
                            message: '长度不能超过 5个字符'
                        }
                    }
                }

                    ,
                defalt:{
                    message: '输入默认值出错',
                    validators:{
                        notEmpty: {
                            message: '默认值不能为空'
                        },
                        stringLength:{
                            max: 19,
                            message: '默认值不能超过 19个字符'
                        }
                    }
                }

                    ,
                describe:{
                    message: '输入中文解释出错',
                    validators:{
                        notEmpty: {
                            message: '中文解释不能为空'
                        },
                        stringLength:{
                            max: 50,
                            message: '中文解释不能超过 50个字符'
                        }
                    }
                }

                    ,
                isprimary:{
                    message: '输入是否主键出错',
                    validators:{
                        notEmpty: {
                            message: '是否主键不能为空'
                        },
                        stringLength:{
                            max: 1,
                            message: '是否主键不能超过 1个字符'
                        }
                    }
                }




                }
            });


        });

    </script>
</head>
<body>

<div class="list-path">
		<span style="margin-left: 50px;"> <a
                href="${base}/xycolumn/list.do"><span
                class="glyphicon glyphicon-home"></span> 表属性列表</a> / <#if entity.columnId??>编辑<#else>新增</#if>表属性
		</span>
    <div style="float: right; margin-right: 40px;">
        <a class="btn btn-info"
           href="javascript:window.history.go(-1)">返回</a>
    </div>
</div>


<div class="table-class">
    <#include "/view/admin/opermsg.html"/>
    <form id="xycolumnForm" action="${base}/xycolumn/save.do"
     >
    <table class="table table-bordered">

                        <input type="hidden" style="display: none" name="columnId" value="${entity.columnId!}"/>


                <tr>
                <th>属性名</th>
                <td>
                    <div class="form-group">
                        <input type="text" class="form-control" id="name" name="name" placeholder="请输入属性名" value="${entity.name!}">
                    </div>
                </td>
                

                
                <th>表名</th>
                <td>
                    <div class="form-group">
                        <select id="tableId" name="tableId"
                                class="form-control selectpicker"   data-live-search="true"
                        >
                            <option value="">请选择表名</option>
                                    <#list listTableId as lv>
                                        <option value="${lv.value!}"
                                        <#if lv.value??&&entity.tableId??&&entity.tableId == lv.value >
                                            selected="selected"
                                        </#if>
                                            >${lv.name!}</option>
                                    </#list>

                        </select>
                    </div>
                </td>
                </tr>

                <tr>
                <th>java属性类型</th>
                <td>
                    <div class="form-group">
                        <select id="columntype" name="columntype"
                                class="form-control"
                        >
                            <option value="">请选择java属性类型</option>
                                            <option value="1" <#if entity.columntype??&&1 == entity.columntype>selected="selected"</#if>>java.lang.String</option>

                                            <option value="2" <#if entity.columntype??&&2 == entity.columntype>selected="selected"</#if>>java.lang.Integer</option>

                                            <option value="3" <#if entity.columntype??&&3 == entity.columntype>selected="selected"</#if>>java.util.Date</option>

                                            <option value="4" <#if entity.columntype??&&4 == entity.columntype>selected="selected"</#if>>java.math.BigDecimal</option>


                        </select>
                    </div>
                </td>
                

                
                <th>长度</th>
                <td>
                    <div class="form-group">
                        <input type="text" class="form-control" id="length" name="length" placeholder="请输入长度" value="${entity.length!}">
                    </div>
                </td>
                </tr>

                <tr>
                <th>默认值</th>
                <td>
                    <div class="form-group">
                        <input type="text" class="form-control" id="defalt" name="defalt" placeholder="请输入默认值" value="${entity.defalt!}">
                    </div>
                </td>
                

                
                <th>中文解释</th>
                <td>
                    <div class="form-group">
                        <input type="text" class="form-control" id="describe" name="describe" placeholder="请输入中文解释" value="${entity.describe!}">
                    </div>
                </td>
                </tr>

                <tr>
                <th>是否主键</th>
                <td>
                    <div class="form-group">
                        <input type="text" class="form-control" id="isprimary" name="isprimary" placeholder="请输入是否主键" value="${entity.isprimary!}">
                    </div>
                </td>
                

                
                <th>创建时间</th>
                <td>
                    <input type="text" class="form-control" value="<#if (entity.createtime)?? >${entity.createtime?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="createtime" name="createtime" data-date-format="yyyy-mm-dd hh:ii:ss">
                </td>
                </tr>

                <tr>
                <th>最后更新时间</th>
                <td>
                    <input type="text" class="form-control" value="<#if (entity.updatetime)?? >${entity.updatetime?string('yyyy-MM-dd HH:mm:ss')}</#if>" id="updatetime" name="updatetime" data-date-format="yyyy-mm-dd hh:ii:ss">
                </td>
                </tr>


        <tr>
            <td colspan="4" width="100%" style="text-align: center;">
                <input type="submit" class="btn btn-success " value="保存"/>
                <span style="width: 20px;">&nbsp;</span>
                <a class="btn btn-danger " href="javascript:window.history.go(-1)">
                   </span>返回</a>
            </td>
        </tr>

    </table>
</form>




</div>

<script type="text/javascript">

</script>


</body>
</html>
